package com.lb.statck.util;

import com.wechat.pay.contrib.apache.httpclient.auth.PrivateKeySigner;
import com.wechat.pay.contrib.apache.httpclient.auth.Verifier;
import com.wechat.pay.contrib.apache.httpclient.auth.WechatPay2Credentials;
import com.wechat.pay.contrib.apache.httpclient.cert.CertificatesManager;
import com.wechat.pay.contrib.apache.httpclient.util.PemUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.function.client.WebClient;

import java.io.FileInputStream;
import java.nio.charset.StandardCharsets;
import java.security.PrivateKey;
import java.security.cert.X509Certificate;

@Configuration
public class WxPayConfig {
    @Value("${spring.weixin.mchId}")
    private String mchId;
    @Autowired
    private WebClient webClient;
    //@Autowired
    //private WxPayConfig wxPayConfig;

    @Value("${wx.miniapp.wechatPayCertificatePath}")
    private  String wechatPayCertificatePath;
    @Value("${spring.weixin.appid}")
    private String appID;
    @Value("${spring.weixin.appsecret}")
    private String appSecret;
    @Value("${wx.miniapp.merchantId}")
    private String merchantId;
    @Value("${wx.miniapp.privateKeyPath}")
    private String privateKeyPath;
    @Value("${wx.miniapp.merchantSerialNumber}")
    private String merchantSerialNumber;
    @Value("${wx.miniapp.apiV3Key}")
    private String apiV3Key;

    @Value("${wx.miniapp.payNotifyUrl}")
    private String payNotifyUrl;
    @Value("${wx.miniapp.refundNotifyUrl}")
    private String refundNotifyUrl;
    @Value("${wx.miniapp.publicKeyId}")
    private String publicKeyId;
    @Value("${wx.miniapp.publicKeyPath}")
    private String publicKeyPath;
   // private String mchId; // 商户号
   // private String mchSerialNo; // 商户API证书序列号
  //  private String privateKeyPath; // 商户私钥文件路径
 //   private String apiV3Key; // APIv3密钥


}